<template>
  <div class="common-layout">



    <!-- <div class="grid-container gallery">
      <div class="grid-item" v-for="imgItem in imgList">
        <img :src="imgItem.img" alt="">
      </div>
    </div> -->
  </div>
</template>


<script setup lang="ts">
import {
  ref,
  reactive,
  getCurrentInstance,
  onMounted,
  toRefs,
  toRaw,
} from "vue";
import { useRouter } from "vue-router";
import { getPublic } from "../request/getPublic"; //获取静态资源
import $apiFun from "../request/api";
//瀑布流
// import { LazyImg, Waterfall } from 'vue-waterfall-plugin-next'
// import 'vue-waterfall-plugin-next/dist/style.css'

const imgList = ref([{}]) as any

const getData = () => {
  console.log('getData')
}
const imgErrorFn = () => {
  console.log('imgErrorFn')

}

onMounted(() => {
  $apiFun.test().then(res => {
    console.log(res)
    imgList.value = res.list
  })
});
</script>




<style>
.common-layout {
  width: 100%;
  height: 300px;
  /* background-color: red; */
}

.grid-container1 {
  width: 100%;
  display: grid;
  grid-template-columns: 30% 30% 30%;
  /* grid-template-rows: 50px 50px; */
  /* display: grid;
  grid-template-columns: repeat(4, 0.1fr); */
  /* 列数和宽度 */
  /* grid-gap: 10px; */
  /* 格子之间的间距 */
}

.item1 {
  background-color: #f1f1f1;
  box-sizing: border-box;
  padding: 20px;
  width: 90%;
  /* padding: 20px; */
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.grid-sizer,
.grid-item {
  width: 24%;
  /* 一行占四张图片，每张图片占 24% 的宽度 */
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
  /* ... 其他样式 ... */
}

.grid-item img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
}

.grid-item .zhezhaotu {
  display: none;
  position: absolute;
  width: 100%;
  height: 99.5%;
  top: 0px;
  left: 0px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  color: white;
  padding-top: .0781rem;
  padding-left: .0781rem;
  padding-right: .1927rem;
  box-sizing: border-box;
  font-size: .1042rem;
  font-family: PingFang SC-Regular, PingFang SC;
  font-weight: 400;
  line-height: .19rem;
  text-align: justify;
}

.grid-item .btn {
  width: .625rem;
  height: .224rem;
  background: #FFFFFF;
  border-radius: .1875rem .1875rem .1875rem .1875rem;
  font-size: .0885rem;
  font-family: PingFang SC-Regular, PingFang SC;
  font-weight: 400;
  color: #333333;
  line-height: .1154rem;
  box-sizing: border-box;
  position: absolute;
  bottom: .1042rem;
  left: 1.48rem;
  transition: all 0.3s ease;
  outline: none;
  border: 0;
  display: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.grid-item .btn:hover {
  background-color: rgb(22, 184, 135, 1);
  color: white;
}

.grid-item .btn:active {
  background-color: white;
  color: #333333;
}


.grid-item .xiazai {
  position: absolute;
  width: .1823rem;
  height: .1823rem;
  bottom: .12rem;
  left: .0885rem;
  background: url(/static_source/image/icon_download.png);
  background-size: 100%;
  display: none;
  cursor: pointer;
}

.grid-item:hover .zhezhaotu {
  display: block;
}

.grid-item:hover .xiazai {
  display: block;
}

.grid-item:hover .btn {
  display: block;
}
</style>
